using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class Approved_invoices_paidMap : EntityTypeConfiguration<Approved_invoices_paid>
    {
        public Approved_invoices_paidMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Invno)
                .IsRequired()
                .HasMaxLength(8);

            this.Property(t => t.type)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.party)
                .HasMaxLength(5);

            // Table & Column Mappings
            this.ToTable("Approved_invoices_paid");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Payment_ID).HasColumnName("Payment_ID");
            this.Property(t => t.Invno).HasColumnName("Invno");
            this.Property(t => t.type).HasColumnName("type");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.Balancebeforepayment).HasColumnName("Balancebeforepayment");
            this.Property(t => t.Balanceafterpayment).HasColumnName("Balanceafterpayment");
            this.Property(t => t.party).HasColumnName("party");
        }
    }
}
